PutResourceMetricRule
Description
call the PutResourceMetricRule interface to set threshold alarm rules for performance indicators of individual resources.
Request Method
POST
Request Path
/apsara/route/cms/PutResourceMetricRule
Request Parameters Common Parameters
Name | Location | Type | Required | Sample value | Description |
---|---|---|---|---|---|
NoEffectiveInterval | BODY | string | No | 00:00-06:00 | the non-effective time range of the alarm rule. |
Escalations.Critical.ComparisonOperator | BODY | string | No | GreaterThanOrEqualToThreshold | Critical level threshold comparator. You can choose according to the following rules: GreaterThanOrEqualToThreshold: greater than or equal to GreaterThanThreshold: greater than LessThanOrEqualToThreshold: less than or equal to LessThanThreshold: less than NotEqualToThreshold: unequal GreaterThanYesterday: up from yesterday LessThanYesterday: down from yesterday GreaterThanLastWeek: up from the same time last week LessThanLastWeek: down from the same time last week GreaterThanLastPeriod: month-on-month increase LessThanLastPeriod: month-on-month decline |
Escalations.Info.ComparisonOperator | BODY | string | No | GreaterThanOrEqualToThreshold | Info level threshold comparator. You can choose according to the following rules: GreaterThanOrEqualToThreshold: greater than or equal to GreaterThanThreshold: greater than LessThanOrEqualToThreshold: less than or equal to LessThanThreshold: less than NotEqualToThreshold: unequal GreaterThanYesterday: up from yesterday LessThanYesterday: down from yesterday GreaterThanLastWeek: up from the same time last week LessThanLastWeek: down from the same time last week GreaterThanLastPeriod: month-on-month increase LessThanLastPeriod: month-on-month decline |
RuleId | BODY | string | Yes | a151cd6023eacee2f0978e03863cc1697c89508**** | alarm rule ID. Description is uniformly generated by the caller. If the alarm rule ID already exists, the alarm rule is modified. If the alarm rule ID does not exist, the alarm rule is created. |
Escalations.Warn.Times | BODY | integer | No | 3 | Warn level alarm retries. |
Escalations.Info.Threshold | BODY | string | No | 90 | Info level alarm threshold. |
MetricName | BODY | string | Yes | cpu_total | monitoring item name. description for details, please refer to main monitoring items of cloud products . |
Escalations.Warn.Statistics | BODY | string | No | Average | Warn level alarm statistics method. |
Escalations.Warn.ComparisonOperator | BODY | string | No | GreaterThanOrEqualToThreshold | Warn level threshold comparator. You can choose according to the following rules: GreaterThanOrEqualToThreshold: greater than or equal to GreaterThanThreshold: greater than LessThanOrEqualToThreshold: less than or equal to LessThanThreshold: less than NotEqualToThreshold: unequal GreaterThanYesterday: up from yesterday LessThanYesterday: down from yesterday GreaterThanLastWeek: up from the same time last week LessThanLastWeek: down from the same time last week GreaterThanLastPeriod: month-on-month increase LessThanLastPeriod: month-on-month decline |
EmailSubject | BODY | string | No | an alarm occurred | alarm mail rule subject. |
RuleName | BODY | string | Yes | my alarm rules | the display name of the alarm rule. |
ContactGroups | BODY | string | Yes | default alarm contact group | alarm contact group. description multiple contact groups are separated by English commas. |
SilenceTime | BODY | integer | No | 86400 | channel silence period, in seconds, the default is 86400 seconds (1 day). description when the monitoring data continuously exceeds the alarm rule threshold, only one alarm notification will be sent in each silence period. |
Escalations.Info.Times | BODY | integer | No | 3 | Info level alarm retries. |
Escalations.Info.Statistics | BODY | string | No | Average | Info level alarm statistics method. |
Period | BODY | string | No | 60 | the aggregation period of monitoring data, in seconds, with a value of 60 or an integer multiple of 60. the default period is the original reporting period of monitoring data. |
EffectiveInterval | BODY | string | No | 00:00-23:59 | the effective time range of the alarm rule. |
version | BODY | string | No | 2016-01-01 | version of api |
Namespace | BODY | string | Yes | acs_ecs_dashboard | the data namespace of the product. description for details, please refer to main monitoring items of cloud products . |
Escalations.Critical.Statistics | BODY | string | No | Average | Critical level alarm statistics method. |
Escalations.Warn.Threshold | BODY | string | No | 90 | Warn level alarm threshold. |
regionId | BODY | string | Yes | No sample value for this parameter. | region id |
Escalations.Critical.Times | BODY | integer | No | 3 | Critical level alarm retries. |
Webhook | BODY | string | No | http://ww.aliyun.com | callback the specified URL address when the alarm occurs. Send a POST request to the URL. |
Resources | BODY | string | Yes | [{"instanceId":"xxxxxxx"}] | resources that require alarms. description for details, please refer to cloud product main monitoring item Dimensions information. |
Escalations.Critical.Threshold | BODY | string | No | 90 | Critical level alarm threshold. |
Interval | BODY | string | No | 60 | the detection period of the alarm rule, that is, how often does the alarm system check whether the alarm rule is triggered. The unit is seconds, which is the minimum frequency of the monitoring item by default. description for monitoring data frequency, please refer to DescribeMetricMetaList. |
Return data
Name | Type | Sample value | Description |
---|---|---|---|
Message | string | success | error message. |
RequestId | string | 65D50468-ECEF-48F1-A6E1-D952E89D9436 | request ID. |
Code | string | 200 | status code. description status code 200 indicates success. |
Success | boolean | true | whether the request was successful. |
Example
Successful Response example
{
"Message":"success",
"RequestId":"65D50468-ECEF-48F1-A6E1-D952E89D9436",
"Code":"200",
"Success":"true"
}
Failed Response example
{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}
}